//
//  DisposeBag.swift
//  PokeMaster
//
//  Created by 李腾芳 on 2022/1/12.
//  Copyright © 2022 OneV's Den. All rights reserved.
//

import Foundation
import Combine

class DisposeBag {
    private var values = [AnyCancellable]()
    func add(_ value: AnyCancellable) {
        values.append(value)
    }
}

extension AnyCancellable {
    func addToDisposeBag(_ disposeBag: DisposeBag) {
        disposeBag.add(self)
    }
}
